package com.example.admin.controller;

import com.example.admin.common.result.R;
import com.example.admin.service.DashboardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Api(tags = "仪表盘接口")
@RestController
@RequestMapping("/api/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    @ApiOperation("获取统计数据")
    @GetMapping("/statistics")
    public R<Map<String, Integer>> getStats() {
        return R.ok(dashboardService.getStatistics());
    }
} 